package cn.lds.healthexamspringboot.controller;

import cn.lds.healthexamspringboot.domain.HealthExamPackage;
import cn.lds.healthexamspringboot.dto.ResponseDTO;
import cn.lds.healthexamspringboot.service.HealthExamPackageService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class HomeController {

    @Resource
    private HealthExamPackageService healthExamPackageService;

    @GetMapping
    public String home(Model model){

        ResponseDTO<List<HealthExamPackage>> listResponseDTO = healthExamPackageService.selectHealthExamPackageAll();

        model.addAttribute("result",listResponseDTO);

        return "index";
    }

    @GetMapping("go_403")
    public String toPage403(){
        return "page_403";
    }
}
